import java.io.Serializable;

public class User implements Serializable, Conveyable {

    private static final long serialVersionUID = 3732190694678648122L;
    private String userName;
    private String password;


    public User() {
    }

    public User(String userName) {
        this.userName = userName;
    }

    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "userName='" + userName + '\'' +
                ", password='" + password + '\'';
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof User) {
            return this.getUserName().equals(((User) obj).getUserName());
        }
        return super.equals(obj);
    }

    @Override
    public int hashCode() {
        return this.getUserName().hashCode()*17+1026984151;
    }
}
